<!--微信小程序配置页面-->
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div>
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-button @click="getDataList()">刷新</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="dataListLoading" :data="dataList" stripe highlight-current-row
                @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle"
                style="width: 100%;">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <el-table-column prop="appid" label="appid" header-align="center" align="center" width="" fixed show-overflow-tooltip></el-table-column>
<!--        <el-table-column prop="aesKey" label="aesKey" header-align="center" align="center" width="" fixed show-overflow-tooltip></el-table-column>-->
<!--        <el-table-column prop="msgDataFormat" label="msgDataFormat" header-align="center" align="center" width="" fixed show-overflow-tooltip></el-table-column>-->
        <el-table-column prop="secret" label="secret" header-align="center" align="center" width="" show-overflow-tooltip>
          <template slot-scope="{row}">
            <el-popover trigger="click" placement="top">
              <p>{{row.secret }}</p>
              <div slot="reference" class="name-wrapper">
                <el-tag size="medium" style="cursor:pointer">查看</el-tag>
              </div>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column prop="formalOrTest" label="二维码版本" header-align="center" align="center" width="">
          <template slot-scope="{row,$index}">
            <div >
              {{ $getDictLabel("formal_or_test", row.formalOrTest) }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="referrer" label="推荐人验证" header-align="center" align="center" width="">
          <template slot-scope="{row,$index}">
            <div >
              {{ $getDictLabel("referrer", row.referrer) }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="createDate" label="创建日期" header-align="center" align="center"></el-table-column>
        <el-table-column label="操作" fixed="right" header-align="center" align="center" width="">
          <template slot-scope="scope">
            <el-link v-if="$hasPermission('api:configMiniapp:update')"
                     type="primary"
                     @click="addOrUpdateHandle(scope.row.id)">修改
            </el-link>
          </template>
        </el-table-column>

      </el-table>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>

  </el-card>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './configMiniappAddOrUpdate.vue'
export default {
  mixins: [mixinViewModule],
  data() {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/api/configMiniapp/page',
        getDataListIsPage: true,
        deleteURL: '/api/configMiniapp',
        deleteIsBatch: true
      },
      dataForm: {
        id: '',                         //id
        appid:'',                       //appid
        secret: '',                     //secret
        formalOrTest: '',               //二维码版本
        referrer:'',                    //推荐人验证
      },
    }
  },
  components: {
    AddOrUpdate
  },
  created() {

  },
  methods: {}
}
</script>
